package com.platform.system.service.impl;

import java.util.List;

import com.platform.common.annotation.DataScope;
import com.platform.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.platform.system.mapper.ProPublicProducproOrderMapper;
import com.platform.system.domain.ProPublicProducproOrder;
import com.platform.system.service.IProPublicProducproOrderService;

/**
 * 公益订单信息Service业务层处理
 *
 * @author platform
 * @date 2025-02-23
 */
@Service
public class ProPublicProducproOrderServiceImpl implements IProPublicProducproOrderService {
    @Autowired
    private ProPublicProducproOrderMapper proPublicProducproOrderMapper;

    /**
     * 查询公益订单信息
     *
     * @param id 公益订单信息主键
     * @return 公益订单信息
     */
    @Override
    public ProPublicProducproOrder selectProPublicProducproOrderById(Long id) {
        return proPublicProducproOrderMapper.selectProPublicProducproOrderById(id);
    }

    /**
     * 查询公益订单信息列表
     *
     * @param proPublicProducproOrder 公益订单信息
     * @return 公益订单信息
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<ProPublicProducproOrder> selectProPublicProducproOrderList(ProPublicProducproOrder proPublicProducproOrder) {
        return proPublicProducproOrderMapper.selectProPublicProducproOrderList(proPublicProducproOrder);
    }

    /**
     * 查询公益订单信息列表
     *
     * @param proPublicProducproOrder 公益订单信息
     * @return 公益订单信息
     */
    @Override
    public List<ProPublicProducproOrder> selectProPublicProducproOrderListAll(ProPublicProducproOrder proPublicProducproOrder) {
        return proPublicProducproOrderMapper.selectProPublicProducproOrderList(proPublicProducproOrder);
    }

    /**
     * 新增公益订单信息
     *
     * @param proPublicProducproOrder 公益订单信息
     * @return 结果
     */
    @Override
    public int insertProPublicProducproOrder(ProPublicProducproOrder proPublicProducproOrder) {
        proPublicProducproOrder.setCreateTime(DateUtils.getNowDate());
        return proPublicProducproOrderMapper.insertProPublicProducproOrder(proPublicProducproOrder);
    }

    /**
     * 修改公益订单信息
     *
     * @param proPublicProducproOrder 公益订单信息
     * @return 结果
     */
    @Override
    public int updateProPublicProducproOrder(ProPublicProducproOrder proPublicProducproOrder) {
        proPublicProducproOrder.setUpdateTime(DateUtils.getNowDate());
        return proPublicProducproOrderMapper.updateProPublicProducproOrder(proPublicProducproOrder);
    }

    /**
     * 批量删除公益订单信息
     *
     * @param ids 需要删除的公益订单信息主键
     * @return 结果
     */
    @Override
    public int deleteProPublicProducproOrderByIds(Long[] ids) {
        return proPublicProducproOrderMapper.deleteProPublicProducproOrderByIds(ids);
    }

    /**
     * 删除公益订单信息信息
     *
     * @param id 公益订单信息主键
     * @return 结果
     */
    @Override
    public int deleteProPublicProducproOrderById(Long id) {
        return proPublicProducproOrderMapper.deleteProPublicProducproOrderById(id);
    }
}
